﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MobileSales.Model.Employees;
using System.ServiceModel.Web;

namespace MobileSales.Server.RestServices
{
    [ServiceContract]
    public interface IEmployeeServiceREST
    {
        #region Employee management

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetEmployee/{employeeId}")]
        Employee GetEmployee(string employeeId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetEmployeeList")]
        IEnumerable<Employee> GetEmployeeList();
        #endregion

        #region Message management

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetMessage/{messageId}")]
        Message GetMessage(string messageId);

        [OperationContract]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                Method = "POST",
                UriTemplate = "DeleteMessage")]
        void DeleteMessage(int messageId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetMessageList/{employeeId}")]
        IEnumerable<Message> GetMessageList(string employeeId);

        [OperationContract]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                Method = "POST",
                UriTemplate = "SendMessage")]
        void SendMessage(int senderId, int recipientId, string subject, string content);

        [OperationContract]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                Method = "POST",
                UriTemplate = "ReadMessage")]
        void ReadMessage(int messageId);

        #endregion
    }
}
